<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Roles
 *
 * @property integer $id
 * @property string $role
 * @property string $deleted_at
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @method static \Illuminate\Database\Query\Builder|\App\Roles whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Roles whereRole($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Roles whereDeletedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Roles whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Roles whereUpdatedAt($value)
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\UserInfo[] $user_x_roles
 */

class Roles extends Model{
    protected $table = 'roles';
    use SoftDeletes;
    protected $fillable  = ['id', 'role'];

    public function user_x_roles()
    {
        return $this->belongsToMany('App\UserInfo','user_roles','role_id','userinfo_id');
    }
}